﻿var outputArea;

$(function () {
    outputArea = $("textarea #outputArea");

    if (typeof unityObject != "undefined") {
        unityObject.embedUnity("unityPlayer", "../Resources/VPLabs/atwood_old.unity3d", 480, 320);
    }
});

function GetUnity() {
    if (typeof unityObject != "undefined") {
        return unityObject.getObjectById("unityPlayer");
    }
    return null;
}

function MapleCalculate(arg) {
    PageMethods.Calculate(arg, OnResult);
}

function OnResult(result) {
    alert('result.length = ' + result.length);
    GetUnity().SendMessage("__WebConnector", "UnityCall", result);
    outputArea.value += "\n" + result;
}